package nspel

type DataSource struct {
	Database Database
	Redis    Redis
}

type Database struct {
	AliasName      string
	DriveName      string
	DataSourceName string
	MaxIdle        int
	MaxOpen        int
}

type Redis struct {
	Host     string
	Port     int
	Password string
	DB       int
	MaxIdle  int
	MaxOpen  int
	LifeTime int
}

func DataSourceInit(filePath string) {
	var dataSource DataSource
	parseJson(filePath, &dataSource)
	setOrmEngine(dataSource.Database)
	redisEngineInit(dataSource.Redis)
}
